package com.example.springhibernate.dto;

import lombok.Data;

import javax.validation.constraints.Min;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;

/**
 * Person
 *
 * @author zhouxianfeng
 * @date 2021-4-13
 */
@Data
public class Person {

    @NotEmpty(message = "{com.example.springhibernate.dto.Person.name.notempty}")
    private String name;

    @NotEmpty(message = "{com.example.springhibernate.dto.Person.address.notempty}")
    private String address;

    @NotNull(message = "{com.example.springhibernate.dto.Person.age.notnull}")
    @Min(value = 18, message = "{com.example.springhibernate.dto.Person.age.min}")
    private Short age;
}
